<template>
    <p>这是Home页</p>
    <p>js跳转</p>
    <button @click="pushStr">push-字符串-跳转</button>
    <button @click="pushPath">push-路径-跳转</button>
    <button @click="pushNameParams">push-命名路由-跳转</button>
    <button @click="pushPathQuery">push-路径-跳转</button>
</template>

<script>
export default{
    methods:{
        pushStr(){
            this.$router.push('/about')
        },
        pushPath(){
            this.$router.push({path:'/about'})
        },
        pushNameParams(){
            this.$router.push({name:'about',state:{params:{id:123,name:'tom'}}})
        },
        pushPathQuery(){
            this.$router.push({path:'/about',query:{id:123,name:'tom'}})
        }
    },
    mounted(){
        console.log('this.$route',this.$route);
        console.log('this.$router',this.$router);
    }
}
</script>